package mark.tom.pistols.encryptor;

import java.util.HashMap;
import java.util.Map;

import mark.tom.pistols.encryptor.builders.AESKeyGen;
import mark.tom.pistols.encryptor.builders.DESKeyGen;
import mark.tom.pistols.encryptor.builders.RSAKeyGen;

/**
 * @Description: 加密算法密钥生成器工厂
 * @Author: ttmk110@163.com
 * @Package: mark.tom.pistols.encryptor
 * @Date: 2020/7/11
 * @Copyright: 版权归 Mark 所有
 * <ModifyLog>
 * @ModifyContent:
 * @Author:
 * @Date: </ModifyLog>
 */
public class EncryptKeyGenFactory {

    private static Map<String, EncryptKeyGen> encryptKeyGenMap = new HashMap<String, EncryptKeyGen>();

    static {
        encryptKeyGenMap.put("RSA", new AESKeyGen());
        encryptKeyGenMap.put("DES", new DESKeyGen());
        encryptKeyGenMap.put("AES", new RSAKeyGen());
    }

    public static EncryptKeyGen getEncryptKeyGenByCipher(String cipher) {
        return encryptKeyGenMap.get(cipher);
    }
}
